package kyssion.leetcode.num51_100;

public class code70_爬楼梯 {
    public static void main(String[] args) {
        System.out.println(new code70_爬楼梯().climbStairs(3));
    }

    public int climbStairs(int n) {
        if (n < 3) {
            return n;
        }
        int be1 = 1;
        int be2 = 2;
        int beN = 0;
        for (int a = 3; a <= n; a++) {
            beN = be1+be2;
            be1=be2;
            be2=beN;
        }
        return beN;
    }
}
